package com.gcsoftware.web.beans.elasticsearchData;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.util.List;

/**
 *  ES 返回实体类
 *  @author czp
 *  date : 2018-03-31
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Hits<T> implements Serializable {
    @JsonProperty("hits")
    private List<Hit<T>> hits;

    @JsonProperty("max_score")
    private double maxScore;

    @JsonProperty("total")
    private long total;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("hits", hits)
                .append("total", total)
                .append("max_score", maxScore)
                .toString();
    }

    public List<Hit<T>> getHits() {
        return hits;
    }

    public void setHits(List<Hit<T>> hits) {
        this.hits = hits;
    }

    public double getMaxScore() {
        return maxScore;
    }

    public void setMaxScore(double maxScore) {
        this.maxScore = maxScore;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }
}
